"""middle table changed

Revision ID: b7fc7a0956e0
Revises: fb357b235baa
Create Date: 2025-10-29 12:28:48.535372

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision: str = 'b7fc7a0956e0'
down_revision: Union[str, Sequence[str], None] = 'fb357b235baa'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('t_user_roles', sa.Column('role_id', sa.Integer(), nullable=False))
    op.drop_constraint(op.f('t_user_roles_ibfk_1'), 't_user_roles', type_='foreignkey')
    op.create_foreign_key(None, 't_user_roles', 'tb_role_players', ['role_id'], ['id'])
    op.drop_column('t_user_roles', 'roler_id')
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('t_user_roles', sa.Column('roler_id', mysql.INTEGER(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 't_user_roles', type_='foreignkey')
    op.create_foreign_key(op.f('t_user_roles_ibfk_1'), 't_user_roles', 'tb_role_players', ['roler_id'], ['id'])
    op.drop_column('t_user_roles', 'role_id')
    # ### end Alembic commands ###
